package agentspeak.editors;

import org.eclipse.jface.text.rules.*;

public class ASLPartitionScanner extends RuleBasedPartitionScanner {
	public final static String ASL_COMMENT_MULTILINE = "__asl_comment_multiline";
	public final static String ASL_COMMENT = "__asl_comment";
	public final static String ASL_PLAN = "__asl_plan";
	public final static String ASL_INIT_DESIRE = "__asl_init_desire";
	public final static String ASL_SYNTAX = "__asl_syntax";
	
	public ASLPartitionScanner() {

		IToken aslCommentMultiline = new Token(ASL_COMMENT_MULTILINE);
		IToken aslComment = new Token(ASL_COMMENT);
		IToken aslPlan = new Token(ASL_PLAN); 
		IToken aslInitDesire = new Token(ASL_INIT_DESIRE);
		IToken aslSyntax = new Token(ASL_SYNTAX);

		IPredicateRule[] rules = new IPredicateRule[]{
				
				new MultiLineRule("/*", "*/", aslCommentMultiline),
				new EndOfLineRule("//", aslComment),
				new SingleLineRule("!", ".", aslInitDesire),
				new MultiLineRule("+!", ".", aslPlan),
				new PlanRule(aslPlan),
				new SingleLineRule("private", " ", aslSyntax)
		};

		setPredicateRules(rules);
	}
}
